# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dinouml
pkgver=0.9.5
pkgrel=2
pkgdesc='A network simulation tool, based on UML (User Mode Linux) that can simulate big Linux networks on a single PC'
url='http://kernel.embedromix.ro/us/'
license=('GPL')
groups=('blackarch' 'blackarch-networking')
arch=('x86_64' 'aarch64')
source=("http://kernel.embedromix.ro/us/DinoUML/DinoUML-$pkgver.tar.bz2"
        'dinouml.1.gz')
sha512sums=('30e2ab04cc403124f0e5f9d31b939f6b453c81c1925a821978c0c0f2f70eb47eb27355fbb81fe5a5652cf0631cf2f1b44163a000e6394fedf2c639bdf0f90820'
            'd5a9ec68e7278a8075fcef43b7af7bf04e6418b861866a62cd96234cb0a76e762c7feb2807e599c9d62fbd71aeac0b507b0349813f8210607f5cb3d180481156')

prepare() {
  cd "DinoUML-$pkgver"

  chmod +x examples/ospf2/overlay
  chmod +x examples/bgp-v4/overlay
}

build() {
  cd "DinoUML-$pkgver"

  make
}

package() {
  cd "DinoUML-$pkgver"

  install -Dm 755 "src/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README Changelog TODO

  rm README Changelog TODO

  cp -a cfg examples external kernels roots "$pkgdir/usr/share/$pkgname/"

  install -Dm 644 "../$pkgname.1.gz" "$pkgdir/usr/share/man/man1/$pkgname.1.gz"
}

